package com.example.utils;

import com.example.utils.redistemplate.RedisTemplateUtils;

import java.util.Optional;

/**
 * @author ChenXiaoBin
 * on 2020-03-15
 */
public class RedisListOrder implements Runnable {
    private RedisTemplateUtils redisTemplateUtils;

    public RedisListOrder(RedisTemplateUtils redisTemplateUtils) {
        this.redisTemplateUtils = redisTemplateUtils;
    }
    @Override
    public void run() {
        while(true) {
            String value = redisTemplateUtils.leftPop("redisList").toString();
            if (value != null) {
                System.out.println(value);
            }
        }
    }
}
